<?
//引入所有子系统信息
include_once("../../../common/model/extender_import.php");

//用来判断当前系统属于什么板块
$system_part = 'order';

$_REQUEST['select_keywords'] = trim($_REQUEST['select_keywords']);

//同意加上and，然后去除左边的and就可以了。
if($_REQUEST['select_keywords'])
{
    $keywords=" and order_sn like '%".$_REQUEST['select_keywords']."%' ";
}
else
{
    $keywords="";
}

if($_REQUEST['select_startday'])
{
    $start_date=$_REQUEST['select_startday'];
    $start_date_str=" and add_date >= '".$start_date." 00:00:00'";
}
else
{
    $start_date_str="";
}

if($_REQUEST['select_endday'])
{
    $end_date=$_REQUEST['select_endday'];
    $end_date_str=" and add_date <= '".$end_date." 23:59:59'";
}
else
{
    $end_date_str="";
}

if($_REQUEST['today'])
{
    $start_date=date("Y-m-d");
    $start_date_str=" and add_date >= '".$start_date." 00:00:00'";

    $end_date=date("Y-m-d");
    $end_date_str=" and add_date <= '".$end_date." 23:59:59'";
}

$select_str=$keywords.$start_date_str.$end_date_str;
//echo $select_str;

//检查类型  进行跳转处理
//if($_REQUEST['search'] == '导出汇总' ){
//
//	 if($_REQUEST['search'] == '导出汇总'){
//		$type = 1;
//	 }
//
//	 header("location:export.php?keywords=".$_REQUEST['select_keywords']."&select_startday=".$_REQUEST['select_startday']."&select_endday=".$_REQUEST['select_endday']."&type=".$type);
//	 exit;
//}


$orderlist=select_lines_all_items($table_prefix."order_list",""," 1=1 ".$select_str,"");


?>

